import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            name: 'index',
            component: () => import('@/views/Index.vue'),
            children: [
                { path: '', name: 'home', component: () => import('@/views/Home.vue') },
                { path: 'template/:id', name: 'template', component: import('@/views/TemplateDetail.vue'), meta: { title: '模版详情' } },
                { path: 'works', name: 'works', component: import('@/views/Works.vue')}
            ]
        },
        {
            path: '/editor',
            name: 'editor',
            component: () => import('@/views/Home.vue')
        },
        // {
        //     path: '/template/:id',
        //     name: 'template',
        //     component: () => import('@/views/Home.vue')
        // }
    ]
})

export default router